<template>
  <div>
    <TypeNav />
    <List />
    <Recommend />
    <Rank />
    <Like />
    <Floor v-for="floor in floorList" :key="floor.id" :floor="floor" />
    <Brand />
  </div>
</template>
<script>
import Brand from './components/Brand';
import Floor from './components/Floor';
import Like from './components/Like';
import List from './components/List';
import Rank from './components/Rank';
import Recommend from './components/Recommend';
import TypeNav from '@comp/TypeNav';
import { reqFloorList } from '@/api';

export default {
  name: 'Home',
  components: {
    Brand,
    Floor,
    Like,
    List,
    Rank,
    Recommend,
    TypeNav,
  },
  data() {
    return {
      floorList: [],
    };
  },
  mounted() {
    // 初始化请求floorList数据
    this.getFloorList();
  },
  methods: {
    // 1.获取floorList的初始化请求函数
    async getFloorList() {
      const result = await reqFloorList();
      this.floorList = result;
    },
  },
};
</script>
<style scoped lang="less"></style>
